<template>
	<view class="container" :style="{'min-heihgt':height}">
		<view class="nav" :style="{height:nav_h}">
			<view class="navigation">
				<image src="../../static/images/back.png" v-on:click="reback"></image>
				<view>
					体质测试
				</view>
			</view>
		</view>
		<view class="title">体质辨识结果</view>
		<view class="answer_title">您的体质：<text>{{title}}</text></view>
		<image mode="widthFix" :src="result.photo"></image>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.monty}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content1}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content2}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content3}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content4}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content6}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content7}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content8}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content9}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content10}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content11}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content12}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content13}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content14}}</view>
		</view>
		<image mode="widthFix" :src="result.xuewei"></image>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content15}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content16}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content17}}</view>
		</view>
		<view class="ul">
			<view class="li"></view>
			<view class="content">{{result.content18}}</view>
		</view>
		<!-- <view class="bottom_title">科学养生  全家幸福</view>
		<view class="copyright">中华中医药学会中医体质分会 技术研发</view> -->
	</view>
</template>
<style>
	.nav{width:100%;padding-bottom: 20upx;display: flex;justify-content: flex-start;
	      align-items: flex-end;}
	.navigation{width:95%;padding-left:5%;height: 50upx;font-size: 28upx;color: #333;text-align: center;display: flex;justify-content: flex-start;align-items: center;}
	.navigation image{width:40upx;height: 40upx;padding:5upx 30upx;border-radius: 25upx;background: #F1F1F1;}
	.navigation view{font-size: 28upx;color: #333;text-align: center;margin-left:30%;}
	.nav_lh{width:100%;}
	
	.container{width: 100%;background-size: 100% auto;background-repeat: repeat-y;
				background-image: url("https://zhangjie.jdmuguzhid.com/static/images/yztang/test_bg.jpg");}
	.title{width:100%;padding-top:140upx;height: 120upx;line-height: 120upx;font-size: 32upx;font-weight: bold;color: #333;text-align: center;border-bottom: 1px solid #666;}
	.answer_title{width:100%;height:80upx;line-height: 80upx;font-size:36upx;color: #2ccdac;text-align: center;}
	.answer_title text{font-size: 48upx;font-weight: bold;}
	image{width:80%;margin:20upx 10%;}
	.ul{width:80%;margin:20upx 10%;display: flex;justify-content: flex-start;align-items: flex-start;}
	.li{width:40upx;height: 40upx;border-radius: 25upx;background-image: linear-gradient(#43eac9, #24c3a4);margin:10upx;}
	.content{width:90%;line-height: 50upx;font-size: 28upx;}
	.bottom_title{width:100%;height: 80upx;line-height: 80upx;text-align: center;background: #2ccdac;color: #FFFFFF;font-size: 32upx;}
	.copyright{width:100%;text-align: center;font-size: 28upx;}
</style>
<script>
	export default {
		data() {
			return {
				title:'',
				result:[],
				height:'',
				statusBar:'',
				nav_h:'',
				nav_lh:'',
				url: getApp().globalData.url,
				static:getApp().globalData.static
			}
		},
		onLoad(e) {
			var res = uni.getSystemInfoSync();
			console.log(res);
			this.nav_h  = res.statusBarHeight +35+ "px";
			this.nav_lh = res.statusBarHeight +45+ "px";
			this.height = res.screenHeight+"px";
			this.statusBar = res.statusBarHeight+"px";
		},
		onShow(){
			this.initialize();
		},
		methods: {
			reback:function()
			{
				uni.navigateBack();
			},
			initialize:function()
			{
				var that = this;
				var member_id = uni.getStorageSync("member_id");
				uni.request({
					url: this.url+"/wechat_get_answer",
					data: {member_id:member_id,number:0},
					header: {'Content-Type': 'application/json'},
					success: function (res) 
					{
						console.log(res);
						that.result = res.data.result;
						var str = that.result.title1.split("：");
						that.title = str[1];
					}
				})
			},
			grade_selected:function()
			{
				if(this.grade==0)
				{
					this.grade = 1;
				}
				else
				{
					this.grade = 0;
				}
				uni.setStorageSync("gender",this.grade);
			},
			button_start:function()
			{
				uni.navigateTo({
					url:"question?number=0"
				})
			}
		}
	}
</script>